import 'package:json_annotation/json_annotation.dart';
part 'village_grid_response.g.dart';

@JsonSerializable()
class VillageGridResult {
  List<VillageBuildGridResult> buildingList;
  int total;
  int villageId;

  VillageGridResult();
  //不同的类使用不同的mixin即可
  factory VillageGridResult.fromJson(Map<String, dynamic> json) =>
      _$VillageGridResultFromJson(json);
  Map<String, dynamic> toJson() => _$VillageGridResultToJson(this);
}

@JsonSerializable()
class VillageBuildGridResult {
  String buildingCode;
  String buildingName;
  int buildingId;
  List<VillageUnitGridResult> itemList;

  VillageBuildGridResult();
  //不同的类使用不同的mixin即可
  factory VillageBuildGridResult.fromJson(Map<String, dynamic> json) =>
      _$VillageBuildGridResultFromJson(json);
  Map<String, dynamic> toJson() => _$VillageBuildGridResultToJson(this);
}

@JsonSerializable()
class VillageUnitGridResult {
  String itemCode;
  String itemName;
  int itemId;
  List<VillageHouseGridResult> roomList;

  VillageUnitGridResult();
  //不同的类使用不同的mixin即可
  factory VillageUnitGridResult.fromJson(Map<String, dynamic> json) =>
      _$VillageUnitGridResultFromJson(json);
  Map<String, dynamic> toJson() => _$VillageUnitGridResultToJson(this);
}

@JsonSerializable()
class VillageHouseGridResult {
  String roomCode;
  String roomName;
  int roomId;
  int itemId;
  int ownerId;

  VillageHouseGridResult();
  //不同的类使用不同的mixin即可
  factory VillageHouseGridResult.fromJson(Map<String, dynamic> json) =>
      _$VillageHouseGridResultFromJson(json);
  Map<String, dynamic> toJson() => _$VillageHouseGridResultToJson(this);
}
